const Koa = require("koa");
const router = require("./router");
const naocs = require("./naocs");

const app = new Koa();
app.use(async (ctx, next) => {
  console.log("请求path", ctx.request.path);
  console.log("请求url", ctx.request.url);
  await next();
});
app.use(naocs());
app.use(router.routes());
app.use(router.allowedMethods());
app.use((ctx) => {
  
  ctx.body = "404";
});
app.listen(3000, () => {
  console.log("启动成功");
});
